package com.thinkgsp.jxc.model;

import java.math.BigDecimal;
import java.sql.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 盘点单明细
 * @author evan
 *
 */
public class CheckBillDetail extends BaseModel {

	private static final long serialVersionUID = 92904052538132314L;

	private Long id;
	private Long billId;
	private Integer productId;
	private Long batchNoId;
	private BigDecimal checkQty;
	private Date checkTime = new Date(System.currentTimeMillis());
	private Integer checkerId;
	private String remark;
	
	private Product product;
	private ProductBatchNo batchNo;
	private Emp checker;
	
	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the billId
	 */
	public Long getBillId() {
		return billId;
	}

	/**
	 * @param billId the billId to set
	 */
	public void setBillId(Long billId) {
		this.billId = billId;
	}

	/**
	 * @return the productId
	 */
	public Integer getProductId() {
		return productId;
	}

	/**
	 * @param productId the productId to set
	 */
	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	/**
	 * @return the batchNoId
	 */
	public Long getBatchNoId() {
		return batchNoId;
	}

	/**
	 * @param batchNoId the batchNoId to set
	 */
	public void setBatchNoId(Long batchNoId) {
		this.batchNoId = batchNoId;
	}

	/**
	 * @return the checkQty
	 */
	public BigDecimal getCheckQty() {
		return checkQty;
	}

	/**
	 * @param checkQty the checkQty to set
	 */
	public void setCheckQty(BigDecimal checkQty) {
		this.checkQty = checkQty;
	}

	/**
	 * @return the checkerId
	 */
	public Integer getCheckerId() {
		return checkerId;
	}

	/**
	 * @param checkerId the checkerId to set
	 */
	public void setCheckerId(Integer checkerId) {
		this.checkerId = checkerId;
	}

	/**
	 * @return the product
	 */
	public Product getProduct() {
		return product;
	}

	/**
	 * @param product the product to set
	 */
	public void setProduct(Product product) {
		this.product = product;
	}

	/**
	 * @return the batchNo
	 */
	public ProductBatchNo getBatchNo() {
		return batchNo;
	}

	/**
	 * @param batchNo the batchNo to set
	 */
	public void setBatchNo(ProductBatchNo batchNo) {
		this.batchNo = batchNo;
	}

	/**
	 * @return the checker
	 */
	public Emp getChecker() {
		return checker;
	}

	/**
	 * @param checker the checker to set
	 */
	public void setChecker(Emp checker) {
		this.checker = checker;
	}

	@Override
	public String toString() {
		ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
		sb.append("id",this.id)
		  .append("billId",this.billId)
		  .append("productId",this.productId)
		  .append("batchNoId",this.batchNoId)
		  .append("checkQty",this.checkQty);
		
		return sb.toString();
	}

	@Override
	public boolean equals(Object o) {
		if(this == o) {
			return true;
		}
		if(!(o instanceof CheckBillDetail)) {
			return false;
		}
		final CheckBillDetail billDetail = (CheckBillDetail)o;
		if(id != null) {
			return id.equals(billDetail.getId());
		} else {
			return billDetail.getId() == null;
		}
	}

	@Override
	public int hashCode() {
		return (this.id != null ? this.id.hashCode() : 0);
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getCheckTime() {
		return checkTime;
	}

	public void setCheckTime(Date checkTime) {
		this.checkTime = checkTime;
	}

}
